package apiday02;

import java.util.Arrays;

public class MatchesDemo {
    public static void main(String[] args) {
        String email = "xiaojian@qq.com";
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z]+(\\.[a-zA-Z]+)+";
        boolean matches = email.matches(regex);
        if(matches) {
            System.out.println("是正确邮箱");
        }else {
            System.out.println("不是");
        }
        email = "+123+他妈的+456+++789++++++";
        String[] split = email.split("\\+");
        System.out.println(Arrays.toString(split));
        String s = email.replaceAll("他妈的", "*******");
        System.out.println(s);
    }
}
